<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>豆瓣app-登录</title>
    <link rel="shortcut icon" href="https://img3.doubanio.com/favicon.ico">
    <link rel="stylesheet" href="../css/reset.css">
    <link rel="stylesheet" href="../img/icon/font_iconfont/iconfont.css">
    <link rel="stylesheet" href="../css/app-public.css">
    <link rel="stylesheet" href="../css/login/login-public.css">
    <link rel="stylesheet" href="../css/login/login.css">
</head>
<body>
    <div class="mobile">
        <div class="logged_in flexBox">
            <div class="functional_domain flexBox">
                <span class="close iconfont">&#xe600;</span>
            </div>
            <div class="main flexBox">
                <div class="title">
                    <span>欢迎登录豆瓣</span>
                    <span class="emoji">:&nbsp;)</span>
                </div>

                <div class="agreement flexBox">
                    <span class="iconfont checkbox">&#xe657;</span>
                    <span class="content">
                        新手机号将自动注册，已详读并同意
                        <a href="javascript:void(0);">豆瓣使用协议、个人信息保护政策</a>
                    </span>

                    <div class="tip">
                        &#128064;登录前请勾选
                        <span class="sharp"></span>
                    </div>
                </div>

                <div class="login_method">
                    <a href="javascript:void(0);" class="weChat">微信登录</a>
                    <a href="javascript:void(0);" class="account">账号密码登录</a>
                    <a href="javascript:void(0);" class="phone">手机号登录</a>
                </div>
            </div>

            <div class="footer flexBox">
                <div class="more">其他登录方式</div>
                <div class="otherMedia"></div>
            </div>
        </div>
    </div>

    <script src="../lib/jquery-3.6.1.min.js"></script>
    <script src="../js/login-public.js"></script>
    <script>
        // 设置提示框的位置
        $('.tip').css('left',$('.checkbox').offset().left-85);

        // 关闭按钮
        $('.close').on('click',function(){
            console.log(document.referrer);
            
            if(document.referrer == 'http://localhost:3000/app-user.html'){
                window.location.href = 'http://localhost:3000/index.html';
            }
            else{
                window.history.back();
            }
            
        })
        
        // 微信登录
        $('.weChat').on('click',function(){
            console.log($('.checkbox').hasClass('selected'));
            // 如果 协议没勾选，显示提示框，3500ms之后提示框移除
            if($('.checkbox').hasClass('selected') == false){
                $('.tip').show();
                tipBoxShow('tip','100%','117%',3000);  //提示框动画
                setTimeout(function(){
                    $('.tip').hide();
                },3500);
            }
        })
        
        // 账号密码登录
        $('.account').on('click',function(){
            window.location.href = 'http://localhost:3000/login/login-account.html';
        })

        // 手机号登录/注册
        $('.phone').on('click',function(){
            window.location.href = 'http://localhost:3000/login/login-phone.html';
        })
    </script>
</body>
</html>